package top.lyc829.mymusic.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import top.lyc829.mymusic.R
import top.lyc829.mymusic.databinding.ItemGedanDetailSongBinding
import top.lyc829.mymusic.databinding.ItemPlaylistBinding
import top.lyc829.mymusic.model.bean.Song

/**
 * @Author lyc
 * @create 2021-07-18 00:41
 */
class SongAdapter: BaseQuickAdapter<Song, BaseViewHolder>(
    R.layout.item_gedan_detail_song
) {
    override fun convert(holder: BaseViewHolder, item: Song) {
        val binding : ItemGedanDetailSongBinding = ItemGedanDetailSongBinding.bind(holder.itemView)
        binding.itemPlayNo.text = (holder.layoutPosition + 1).toString()
        binding.viewpagerListToptext.text = item.name
        binding.viewpagerListBottomText.text = item.ar.joinToString(separator = "/") {it.name} + " - " + item.al.name
//        if (item.url.isNullOrEmpty()) {
//            binding.root.isClickable = false
//            binding.root.isEnabled = false
//            binding.root.setBackgroundColor(context.getColor(R.color.gray_f5))
//        }
    }

}